home *** CD-ROM | disk | FTP | other *** search
- Path: beach.and.nl!usenet
- From: jos@and.nl (Jos A. Horsmeier)
- Newsgroups: comp.lang.c
- Subject: Re: do || die;
- Date: 11 Mar 1996 14:43:50 GMT
- Organization: AND Operations Research B.V.
- Message-ID: <4i1e76$dvq@beach.and.nl>
- References: <1996Mar7.052636.59812@ucl.ac.uk> <DnwJKs.KyJ@uns.bris.ac.uk> <mjs.826218466@hubcap> <1996Mar11.130836.4955@friend.kastle.com>
- NNTP-Posting-Host: klepzeiker.and.nl
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=ISO-8859-1
- X-Newsreader: WinVN 0.99.5
-
- In article <1996Mar11.130836.4955@friend.kastle.com>, rich@kastle.com wrote:
- |mjs@hubcap.clemson.edu (M. J. Saltzman) wrote:
- |
- |> i -= i != 0
- |>
- |>(which is probably what I would have written).
-
- |Um, wouldn't that be undefined? The value of i is stored and there
- |are two references to i without an intervening sequence point. One
- |reference is implicit by the "-=" operator and the other is explicit.
-
- There's nothing undefined about the expression, although it could
- use a couple of parentheses to avoid the confusion it just caused:
-
- i -= (i != 0)
-
- This simply reads: subtract one from i if i does not equal zero.
-
- BTW, I'm an idiot, so I would have written 'i-= !!i' instead ;-)
-
- kind regards,
-
- Jos aka jos@and.nl
- --
- Atnwgqkrl gy zit vgksr, ug qshiqwtzoeqs!
-
-